<?php

    function photos_post($pictures, $titles, $gallery_ID) {

        $resultArray = array();

        $cnt = count($pictures);
        for ($index = 0; $index < $cnt; $index++) :

            $resultArray[] = array(
                'filename' => $pictures[$index],
                'name' => $titles[$index],
                'gallery_ID' => $gallery_ID
            );

        endfor;

        return $resultArray;
    }

    function files_post($files, $titles, $folder_ID) {

        $resultArray = array();

        $cnt = count($files);
        for ($index = 0; $index < $cnt; $index++) :

            $resultArray[] = array(
                'filename' => $files[$index],
                'name' => $titles[$index],
                'folder_ID' => $folder_ID
            );

        endfor;

        return $resultArray;
    }
    